package com.util;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author longwm
 * @date 2021/6/19 15:39
 * @desc
 */
public class AlipayConfig {
    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117675929";
    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCUAbhUmw0vJhaTcGI1VSNU3sSe4WJEekAefhVW5DLmNgIiq/1GMmOE05JiRpBcrQBdS4v2w7PPskBr0NztNB4eXpDM/oYFeL41J4GJgw7pjNCue2s0YiJ5eOGZbTgbZMZeYn1AHCfuNYeO5lEtkozB+YiFxslIspAwYuHN6xNPwwJ2/XjD1vTiEnWaz/YSAP85S36ICBUjjmHBTmVH9dvr39JovW9ntKGmbmZPXBnsLKB5B2JazclFElZwGN5kHJ8syf2wm4/GMOddhaEZByV1xlesotgrIvBFKKMYsHkn7g4dVnWuHO+VUi7cMEEsPe0z5qSiRs47wqMsK4Q7MeYBAgMBAAECggEAbEAZzp+c8/gamPmgirtbXQ6VplLYKZd0YBj9iJDc/W1RAITkeLwP9606qnBL08ygsJu5oeEfGXCZF4Iqo77zrGij5Zre8Q+PppbfcnENrhnU41jXXvfLmSalci7k03xQbeYBD6vINLyoCgdAJmHCW3kjthxfSbF4LjuURaSCelnVsaqMM6fJLd4rAe4F8txAUMGo1cyn7kQZbhMiQbB2uy5k8pEDN/kc0ZAzHVKAl4MJWARosJ+aPwIjQ6DI7342C7df7SfkLO7AAWdC0HrD2w/OEURJ+XZdoXKi0QJlpZXWbFwxdUdnnyBS4q0ofrN0ARUjeDTiE6xh/cMworqc9QKBgQD0sXo6KXfJrQxwyC0KkslaehYoWRnTsv8ny+XXvmK8a9ByXU/p4J5LKBxi2tvDJ2y2QHeesO3gbpghXrMdD/oIuWTzRJRczVI7vUPWVC8yR8NrptIgYOfYKtdJiXUtM6Q5JpizFx32yjgzam3J05XJYuDVbrwyMDfn8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7t4hYf/BPGPZvgwnsKIfi4Mlz8220iK5Z1WJmxizzHrrIhPBg/2gQIDAQAB";
    // 服务器异步通知页面路径
    //需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://120.79.196.138:8080/alipay/notifyUrl";
    // 页面跳转同步通知页面路径
    //需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://120.79.196.138:8080/alipay/returnUrl";
    // 签名方式
    public static String sign_type = "RSA2";
    // 字符编码格式
    public static String charset = "utf-8";
    // 支付宝网关,注意这些使用的是沙箱的支付宝网关，与正常网关的区别是多了dev
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
    // 支付宝日志
    public static String log_path = "C:\\";

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" +
                    System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
